//
// CXInputPin.h
//

#ifndef __H_CMemDestInputPin__
#define __H_CMemDestInputPin__

#include "GlobalDefs.h"

class CFilterNetSender;
class CXInputPin : public CRenderedInputPin
{
	friend class CFilterNetSender;

private:
	CFilterNetSender *	mFilter;
	CCritSec			mReceiveLock;

	SOCKET				mSocket;
	Pack_Header			mPackHeader;
	BOOL				mIsMediaTypeSent;

public:
	CXInputPin(CFilterNetSender *pFilter, HRESULT *phr);
	~CXInputPin();

	// Filter delegating methods
	void SetStreamSocket(SOCKET inSocket);
	void CancelPendingSend(void);

	// Do something with this media sample
	STDMETHODIMP Receive(IMediaSample *pSample);
	STDMETHODIMP EndOfStream(void);
	STDMETHODIMP BeginFlush(void);
	STDMETHODIMP EndFlush(void);
	STDMETHODIMP ReceiveCanBlock(void);

	// Check if the pin can support this specific proposed type and format
	HRESULT CheckMediaType(const CMediaType * inMediaType);

private:
	int SendMediaType(void);
};

#endif // __H_CMemDestInputPin__